package crm.system.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import crm.base.model.Page;
import crm.system.entity.Agent;
import crm.system.mapper.AgentMapper;

@Service
@Transactional
public class AgentService {
	
	@Autowired
	private AgentMapper agentMapper;
	
	public Agent getAgentByUserName(String userName) {
		return agentMapper.getAgentByUserName(userName);
	}
	
	public Page getAgentPageList(Map<String, ?> params, Page page) {
		page.setResult(agentMapper.getAgentList(params, page));
		return page;
	}

}
